pub fn convert_base(num_str: &str, to_base: u32) -> String {
    let mut iter = num_str[..num_str.len()-1].split('(');
    let data = iter.next().unwrap();
    let base = iter.next().unwrap().parse::<u32>().unwrap();
    let data = u32::from_str_radix(data, base).unwrap();
    convert_to_base(data, to_base)
}

fn convert_to_base(mut num: u32, base: u32) -> String {
    let mut result = String::new();
    while num > 0 {
        let digit = num % base;
        if digit >= 10 {
            result.push_str(&format!("{}", ((digit - 10) as u8 + 'a' as u8) as char));
        } else {
            result.push_str(&format!("{}", digit));
        }
        num /= base;
    }
    result.chars().rev().collect()
}